const { app, BrowserWindow, dialog } = require('electron');
function registerOpenFileDialog(win){
    const openFileDialog = () => {
        const options = {
        title: '选择文件',
        properties: ['openFile'],
        filters: [
            { name: 'All Files', extensions: ['*'] },
        ],
        };
        dialog.showOpenDialog(win, options).then((result) => {
        if (!result.canceled) {
            console.log(result.filePaths[0]); // 选择的文件路径
        }
        }).catch((err) => {
        console.error(err);
        });
    };
    return openFileDialog;
}
module.exports = { registerOpenFileDialog };
